/* 人员信息接口 */
/* 机构树-模糊查询 */
export const organizationSearch = (data) => {
  return axios({
    url: '/org/organization/search',
    params:{
      orgName:data
    },
    method: 'get'
  })
}
/* 根据用户id查询拥有权限的所有父级机构 */
export const organizationRoot = () => {
  return axios({
    url: '/org/organization/root',
    method: 'get'
  })
}
/* 根据父id查询下级机构 */
export const organizationParent = (data) => {
  return axios({
    url: `/org/organization/parent/${data.id}?page=${data.page}&size=${data.size}`,
    method: 'get'
  })
}
/* 根据机构id查询所有员工 */
export const orgEmpOrgOrgId = (orgId, currentPage, currentSize, data) => {
  return axios({
    url: `/org/orgEmpOrg/search/${orgId}?page=${currentPage}&size=${currentSize}`,
    method: 'post',
    data
  })
}
/* 员工查询 */
export const employeeSearch = (type, data) => {
  return axios({
    url: `/org/employee/search/${type}`,
    method: 'post',
    data
  })
}
/* 根据岗位id查询岗位关联的员工 */
export const empPositionPositionId = (data) => {
  return axios({
    url: `/org/empPosition/${data}`,
    method: 'get'
  })
}
/* 根据员工编号进行排序(当前组织下的员工排序) */
export const employeeSort = (oEmpId, nEmpId, orgId) => {
  return axios({
    url: `/org/employee/${oEmpId}/${nEmpId}/${orgId}`,
    method: 'post'
  })
}
/* 员工新增或者更新 */
export const employeeAddOrEdit = (data) => {
  return axios({
    url: '/org/employee',
    method: 'post',
    data
  })
}
/* 直接下拉 */
export const comboBoxDataSelect = (data) => {
  return axios({
    url: `/base/dict/comboBoxData/${data}`,
    method: 'get'
  })
}

/* 新增员工和岗位的关联关系 */
export const empPositionRelation = (datas, data) => {
  return axios({
    url: `/org/empPosition/${datas.empId}/${datas.orgId}`,
    method: 'post',
    data
  })
}
/* 根据员工查询所有岗位 */
export const orgPositionListsDatas = (data) => {
  return axios({
    url: `/org/orgPosition/list/${data}`,
    method: 'get'
  })
}
/* 搜索当前机构下的员工 */
export const employeeSearchOrgId = (datas, data) => {
  return axios({
    url: `/org/employee/search/org/${datas}`,
    method: 'post',
    data
  })
}
/* 根据员工编号获取员工信息 */
export const employeeEmpId = (data) => {
  return axios({
    url: `/org/employee/${data}`,
    method: 'get'
  })
}
/* 人员移动 */
export const upDownRemove = (data) => {
  return axios({
    url: `/org/employee/${data.orgId}/${data.empId}/${data.type}`,
    method: 'post'
  })
}
/* 多文件删除 */
export const photoDel = (data)=>{
  return axios({
    url:`fileupload/file/delete`,
    method:'post',
    data
  })
}
